﻿<Window x:Class="CliPack.WPF.AssembliesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Assembly Manager" Height="300" Width="600" Loaded="Page_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBox x:Name="search" Grid.Column="1"/>
        </Grid>

        <ListBox Grid.Row="1" x:Name="assemblies" HorizontalContentAlignment="Stretch">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Margin="4" BorderThickness="1" CornerRadius="2" BorderBrush="Black" Width="Auto" Padding="4">
                        <StackPanel Orientation="Vertical" Margin="4">
                            <CheckBox 
                                IsChecked="{Binding Path=IsInstalled, Mode=OneWay}"
                                Content="{Binding Path=AssemblyName, Mode=OneWay}"
                                Click="CheckBox_Click"/>
                            <TextBlock Text="{Binding Path=Description, Mode=OneWay}"/>
                            <Button 
                                Padding="8,2,8,2"
                                HorizontalAlignment="Right"
                                Content="Update"
                                IsEnabled="{Binding Path=IsNewerVersionAvailable, Mode=OneWay}"
                                CommandParameter="{Binding Path=AssemblyName, Mode=OneWay}"
                                Click="Button_Click"
                                />
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Window>
